package com.coolingme.general;

/**
 * 中介者模式测试
 *
 * @author wangyue
 * @date 2020-09-26 21:41
 */
public class Test {

    public static void main(String[] args) {
        // 中介者
        ConcreteMediator mediator = new ConcreteMediator();

        // 同事类
        ConcreteColleagueA colleagueA = new ConcreteColleagueA(mediator);
        ConcreteColleagueB colleagueB = new ConcreteColleagueB(mediator);

        // 自己的业务
        colleagueA.selfMethodA();

        System.out.println("--------------------");

        // 需要中介者调用B的业务
        colleagueA.depMethodA();

    }

}
